c# .net

how to use goto statement in c#?

how to use goto statement in c#? , someone asked me to explain?

The goto statement is a jump statement that controls the execution of the program to another segment of the same program.

 

int i = 0;
while (i < 10)
{
if (i == 5)
goto identifier;
}identifier:
MessageBox.Show(i);

 

output:
5

Post your comments / questions